package dao

import (
	"d-blog/model"
	"d-blog/pkg/query"
	"gorm.io/gorm"
)

var SinaTipDao = newSinaTipDao()

type sinaTipDao struct {
}

func newSinaTipDao() *sinaTipDao {
	return &sinaTipDao{}
}

func (receiver *sinaTipDao) GetById(db *gorm.DB, id string) (r model.Tip) {
	r = model.Tip{}
	db.First(&r, "id = ?", id)
	return r
}
func (receiver *sinaTipDao) Find(db *gorm.DB, condition *query.Condition) (list []model.Tip) {
	condition.Find(db, &list)
	return
}
